package com.googlecode.npgame.graphics;

import javax.microedition.khronos.egl.EGLConfig;
import javax.microedition.khronos.opengles.GL10;

import android.opengl.GLSurfaceView;
import android.view.MotionEvent;

import com.googlecode.npgame.screens.MainScreen;
import com.googlecode.npgame.screens.Screen;

/**
 * @author Josh (joshbruning)
 */
public class NetworkProtocolGameRenderer implements GLSurfaceView.Renderer {

  private Screen activeScreen;

  public NetworkProtocolGameRenderer() {
    this.activeScreen = new MainScreen();
  }

  public void onSurfaceCreated(GL10 unused, EGLConfig config) {
    this.activeScreen.onSurfaceCreated(unused, config);
  }

  public void onDrawFrame(GL10 unused) {
    this.activeScreen.onDrawFrame(unused);
  }

  public void onSurfaceChanged(GL10 unused, int width, int height) {
    this.activeScreen.onSurfaceChanged(unused, width, height);
  }

  public boolean onTouchEvent(MotionEvent event) {
    return this.activeScreen.onTouchEvent(event);
  }
}
